package com.hk.common.ret;

import lombok.Getter;

/**
 * 返回对象实体
 */
@Getter
public class RetResult<T> {
    public int code;//状态码

    private String msg;//提示信息

    private T data;//返回的具体数据

    public RetResult() {
    }

    public RetResult(RetCode retCode) {
        this.code = retCode.getCode();
        this.msg = retCode.getMsg();
    }

    public RetResult<T> setCode(int code) {
        this.code = code;
        return this;
    }

    public RetResult<T> setMsg(String msg) {
        this.msg = msg;
        return this;
    }

    public RetResult<T> setData(T data) {
        this.data = data;
        return this;
    }
}
